//
//  OrderInfoHeaderView.m
//  Findif
//
//  Created by Mac on 2018/12/19.
//  Copyright © 2018年 Cicel Chen. All rights reserved.
//

#import "OrderInfoHeaderView.h"

@interface OrderInfoHeaderView ()

@property (nonatomic, weak)UIImageView * msgImageView;
@property (nonatomic, weak)UILabel * titleLabel;
@property (nonatomic, weak)UIView * lineView;


@end

@implementation OrderInfoHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    
    self.backgroundColor = ZRWhiteColor;
    
    UIImageView * msgImageView = [UIImageView new];
    
    msgImageView.image = [UIImage imageNamed:@"订单信息"];
    
    self.msgImageView = msgImageView;
    
    [self addSubview:self.msgImageView];
    
    UILabel * titleLabel = [UILabel new];
    
    titleLabel.textColor = ZRBlackColor;
    titleLabel.text = @"订单信息";
    titleLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.titleLabel = titleLabel;
    
    [self addSubview:self.titleLabel];
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xe4e4e4);
    
    self.lineView = lineView;
    
    [self addSubview:self.lineView];
}


- (void)layoutSubviews{
    
    [self.msgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(10 * SCREENH6);
        make.centerY.mas_equalTo(self);
        make.height.mas_equalTo(14 * SCREENH6);
        make.width.mas_equalTo(13 * SCREENH6);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.msgImageView.mas_trailing).offset(5  * SCREENH6);
        make.centerY.mas_equalTo(self.msgImageView);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.msgImageView);
        make.trailing.mas_equalTo(self).offset(-10 * SCREENH6);
        make.height.mas_equalTo(1 * SCREENH6);
        make.bottom.mas_equalTo(self);
    }];
}

@end
